package demo1;

public class Test {
    public static void test1(Animal animal){
        animal.Eat();
    }
    public static void test2(IRunning iRunning){
        iRunning.Running();
    }
    public static void test3(IFlying iFlying){
        iFlying.Flying();
    }
    public static void test4(ISwimming iSwimming){
        iSwimming.Swimming();
    }
    public static void main(String[] args) {
        Dog d = new Dog("小狗", 10);
        test1(d);
        test2(d);
        //test3(d);//error

        System.out.println("================");
        Bird b = new Bird("小鸟", 8);
        test2(b);
        test3(b);
        //test4(b);//error

        Robot r = new Robot("机器人",2);
        //test1(r);//error
        //test3(r);//error
        test2(r);
    }
}